//
//  HRZ_BrandSortCell.m
//  EMarket
//
//  Created by 石头 on 2018/5/13.
//  Copyright © 2018年 好日子. All rights reserved.
//

#import "HRZ_BrandSortCell.h"


// Controllers

// Models
#import "HRZGoodsClassifyBrandModel.h"
// Views

// Vendors
#import <UIImageView+WebCache.h>
// Categories
#import "UIView+SPExtension.h"

// Others


@interface HRZ_BrandSortCell()

/** imageView */
@property (nonatomic, strong) UIImageView *brandImageView;

@end

@implementation HRZ_BrandSortCell

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self setUpUI];
    }
    return self;
}

- (void)setUpUI {
    self.backgroundColor = HRZBGColor;
    _brandImageView = [[UIImageView alloc] init];
    _brandImageView.contentMode = UIViewContentModeScaleAspectFill;
    [self addSubview:_brandImageView];
}

- (void)layoutSubviews {
    
    [_brandImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.center.mas_equalTo(self);
        make.size.mas_equalTo(CGSizeMake(self.sp_width - 10, self.sp_height - 10));
    }];
    
}

- (void)setModel:(HRZGoodsClassifyBrandModel *)model {
    _model = model;
    [_brandImageView sd_setImageWithURL:URLString(_model.trademarkImg) placeholderImage:PLACEHOLDERIMAGE];
}

@end
